import requests


class Send_Method():

    @staticmethod
    def send_Method(method, url, params=None, data=None, json=None, cookies=None, headers=None, files=None, **kwargs):
        if method.lower() == "get":
            try:
                return requests.request(method=method, url=url, params=params, cookies=cookies, headers=headers)
            except:
                # print("接口调用失败!")
                return False
        elif method.lower() == "post":
            try:
                return requests.request(method=method, url=url, data=data, json=json, cookies=cookies, headers=headers,
                                        files=files)
            except:
                print("接口调用失败!")
                return False
        else:
            print('暂不支持该类接口调用')
            return False
